import axios from 'axios';

let base = '/api';

export const requestLogin = params => { return axios.post(`${base}/user/login`, params).then(res => res.data); };

export const getUserList = params => { return axios.get(`${base}/get`, { params: params }); };

export const getUserListPage = params => { return axios.get(`${base}/listpage`, { params: params }); };

export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); };

export const batchRemoveUser = params => { return axios.get(`${base}/user/batchremove`, { params: params }); };

export const editUser = params => { return axios.get(`${base}/user/edit`, { params: params }); };

export const addUser = params => { return axios.get(`${base}/user/add`, { params: params }); };

export const getRoleTyepListPage = params => { return axios.get(`${base}/groupType/page`, { params: params }); };

export const login = params => {
    return axios.post(
        `${base}/user/login`, 
        params
     )
};

export const logout = params =>{
    return axios.post(
        `${base}/user/logout`, 
        params
    )
};

export const getInfo = params => {
    return axios.get(
        `${base}/user/intact/info`, 
        { params : params }
    )
};

export const getMenus = params => {
    return axios.get(
        `${base}/user/intact/menus`, 
        { params : params }
    )
};